import axiosIns from '@/utils/request';
const proxyStr = '/proxy_abhd';

export const fetchZbgl = {
  parentPageList: (data) => {
    const { pageIndex = 1, pageSize = 10 } = data;
    delete data.pageIndex;
    delete data.pageSize;
    return axiosIns.post(`${proxyStr}/abhd/zbgl/queryZbglPageList`, data, {
      params: { pageIndex, pageSize }
    });
  },
  childPageList: (data) => {
    const { pageIndex = 1, pageSize = 10 } = data;
    delete data.pageIndex;
    delete data.pageSize;
    return axiosIns.post(`${proxyStr}/abhd/zbgl/queryZbglLbxxPageList`, data, {
      params: { pageIndex, pageSize }
    });
  },
  addParentItem: (data) => {
    return axiosIns.post(`${proxyStr}/abhd/zbgl/addZbgl`, data);
  },
  addChildItem: (data) => {
    return axiosIns.post(`${proxyStr}/abhd/zbgl/addZbgl`, data);
  },
  updateParentItem: (data) => {
    return axiosIns.put(`${proxyStr}/abhd/zbgl/updateZbgl`, data);
  },
  updateChildItem: (data) => {
    return axiosIns.put(`${proxyStr}/abhd/zbgl/updateZbglLbxx`, data);
  },
  deleteParentItem: (id) => {
    return axiosIns.delete(`${proxyStr}/abhd/zbgl/deleteZbgl/${id}`);
  },
  deleteChildItem: (id) => {
    return axiosIns.delete(`${proxyStr}/abhd/zbgl/deleteZbglLbxx/${id}`);
  },
  allListTree: () => {
    return axiosIns.get(`${proxyStr}/abhd/zbgl/getZbglTreeList`);
  },
}